# serializers.py

from rest_framework import serializers, viewsets
from .models import Table,Title

class TableSerializer(serializers.ModelSerializer):
    class Meta:
        model = Table
        fields = ('like','text','date','title')  # 序列化所有字段


class TitleSerializer(serializers.ModelSerializer):
    class Meta:
        model = Title
        fields = ('title',)